/*
 * PopupCustomButton.hpp
 *
 *  Created on: Mar 11, 2013
 *      Author: guillou
 */

#ifndef POPUPCUSTOMBUTTON_HPP_
#define POPUPCUSTOMBUTTON_HPP_

#include <map>
#include <QPushButton>
#include <PopupUtilities.hpp>

class PopupCustomButton
{
public:
  PopupCustomButton(const QString & p_name,
                        const QString & p_icon,
                        const QString & p_media,
                        const QString & p_text);
  PopupCustomButton(const PopupCustomButton & p_info);
  virtual ~PopupCustomButton() {}

  virtual void setup(const QString & p_icon,
                     const QString & p_media,
                     const QString & p_text);
  inline const QString & name()      const { return m_name; }
  inline const QString & iconPath() const { return m_icon; }
  inline const QString & mediaUrl() const { return m_media; }
  inline const QString & msgText()     const { return m_text; }

  virtual QString toString() const;
  static PopupCustomButton *fromString(const QString & p_string);

protected:
  QString m_name;
  QString m_icon;
  QString m_media;
  QString m_text;
};

class PopupCustomQtButton : public QPushButton, public PopupCustomButton
{
  Q_OBJECT

public:
  PopupCustomQtButton(const PopupCustomButton & p_info);
  virtual void setup(const PopupCustomButton & p_info);
  virtual void refresh();
};

typedef std::list<PopupCustomButton*> PopupCustomButtonList;

#endif /* POPUPCUSTOMBUTTON_HPP_ */
